Communication apparatus

ABSTRACT

A first communication apparatus may repeat a broadcast transmission of a trigger signal via a second interface, which is a signal to be used by a second communication apparatus as a trigger for sending a wireless connection request to the first communication apparatus. The wireless connection request may be for forming a first wireless network to which both the first communication apparatus and the second communication apparatus belong. The first wireless network may be a network for performing a wireless communication via a first interface. The first communication apparatus may receive the wireless connection request via the first interface from the second communication apparatus which has received the trigger signal, and establish a first wireless connection via the first interface with the second communication apparatus so as to form the first wireless network.

CROSS-REFERENCE TO RELATED APPLICATION

This application is continuation application of U.S. application Ser.No. 16/674,270 filed on Nov. 5, 2019, which is a continuationapplication of U.S. application Ser. No. 16/249,071 filed on Jan. 16,2019, now U.S. Pat. No. 10,506,129 issued on Dec. 10, 2019, which is acontinuation application of U.S. application Ser. No. 15/854,889 filedon Dec. 27, 2017, now U.S. Pat. No. 10,205,847 issued on Feb. 12, 2019,which is a continuation application of U.S. application Ser. No.15/635,959 filed on Jun. 28, 2017, now U.S. Pat. No. 9,860,417 issued onJan. 2, 2018, which is a continuation application of U.S. applicationSer. No. 15/079,264 filed on Mar. 24, 2016, now U.S. Pat. No. 9,712,955issued on Jul. 18, 2017, which claims priority to Japanese PatentApplication No. 2015-066067, filed on Mar. 27, 2015, the entire contentsof which are hereby incorporated by reference into the presentapplication.

TECHNICAL FIELD

The present application discloses a communication apparatus capable ofperforming a wireless communication according to a plurality ofcommunication schemes.

BACKGROUND ART

Technology for performing a wireless communication between a firstterminal and an external apparatus according to Wi-Fi is known. Thefirst terminal sends, to the external apparatus via a BLE (abbreviationof Bluetooth (registered trademark) Low Energy), information (i.e. a MACaddress, an SSID, a channel number, a security key, and so forth)related to AP (abbreviation of an access point) to which the firstterminal itself is connected. In this case, the external apparatusactivates a Wi-Fi module, and uses the above information to connect tothe AP. This makes it possible for the first terminal and the externalapparatus to perform a wireless communication according to Wi-Fi.

SUMMARY

The present application discloses a new technology for a communicationapparatus to form a wireless network according to a first communicationscheme after having performed a wireless communication according to asecond communication scheme.

A first communication apparatus may comprise a first interfaceconfigured to perform a wireless communication according to a firstcommunication scheme; a second interface configured to perform awireless communication according to a second communication schemedifferent from the first communication scheme, the second interfaceconfigured to repeat a broadcast transmission of a trigger signal, thetrigger signal being a signal to be used by a second communicationapparatus as a trigger for sending a wireless connection request to thefirst communication apparatus, the wireless connection request being forforming a first wireless network to which both the first communicationapparatus and the second communication apparatus belong, and the firstwireless network being for performing a wireless communication via thefirst interface; a processor; and a memory that stores computer-readableinstructions therein, the computer-readable instructions, when executedby the processor, causing the first communication apparatus to perform:receiving the wireless connection request via the first interface fromthe second communication apparatus which has received the triggersignal; and in response to receiving the wireless connection requestfrom the second communication apparatus, establishing a first wirelessconnection via the first interface with the second communicationapparatus so as to form the first wireless network to which both thefirst communication apparatus and the second communication apparatusbelong.

A control method and computer-readable instructions for implementationof the first communication apparatus described above, and anon-transitory computer-readable recording medium in which thecomputer-readable instructions are stored, are also novel and useful.

The present application further discloses a non-transitorycomputer-readable recording medium storing computer-readableinstructions for a second communication apparatus. The secondcommunication apparatus may comprise a first interface configured toperform a wireless communication according to a first communicationscheme; and a second interface configured to perform a wirelesscommunication according to a second communication scheme different fromthe first communication scheme; and a processor. The computer-readableinstructions, when executed by the processor, may cause the secondcommunication apparatus to perform: receiving a trigger signal from afirst communication apparatus via the second interface in a case wherethe first communication apparatus repeats a broadcast transmission ofthe trigger signal, the trigger signal being a signal to be used by thesecond communication apparatus as a trigger for sending a wirelessconnection request to the first communication apparatus, the wirelessconnection request being for forming a first wireless network to whichboth the first communication apparatus and the second communicationapparatus belong, the first wireless network being for performingwireless communication via the first interface; in response to receivingthe trigger signal from the first communication apparatus, sending thewireless connection request to the first communication apparatus via thefirst interface; and in response to sending the wireless connectionrequest to the first communication apparatus, establishing a firstwireless connection via the first interface with the first communicationapparatus so as to form the first wireless network to which both thefirst communication apparatus and the second communication apparatusbelong.

The second communication apparatus described above itself is also noveland useful. Moreover, a communication system comprising the firstcommunication apparatus and the second communication apparatus describedabove is also novel and useful.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a configuration of a communication system.

FIG. 2 shows a flowchart of a Wi-Fi I/F relation process of a printer.

FIG. 3 shows a flowchart of a BT I/F relation process of a printer.

FIG. 4 shows a flowchart of a process of mobile terminal.

FIG. 5 shows a sequence chart for a case A of a first embodiment.

FIG. 6 shows sequence charts for cases B1 and B2 of the firstembodiment.

FIG. 7 shows a flowchart of a Wi-Fi I/F relation process of a printer ofa second embodiment and a third embodiment.

FIG. 8 shows a sequence chart for a case C of the second embodiment.

FIG. 9 shows a sequence chart for cases D1 and D2 of the secondembodiment.

FIG. 10 shows a sequence chart for a case E of the third embodiment.

FIG. 11 shows a sequence chart for cases F1 and F2 of the thirdembodiment.

EMBODIMENTS First Embodiment (Configuration of Communication System 2)

As shown in FIG. 1, a communication system 2 comprises a printer PR anda plurality of portable terminals PT1 and PT 2. The printer PR and theportable terminals PT1 and PT 2 are able to perform a wirelesscommunication with one another.

(Configuration of Printer PR)

The printer PR is a peripheral device that is capable of performing aprint function, that is, a peripheral device such as the portableterminal PT1. The printer PR comprises an operation unit 12, a displayunit 14, a print performing unit 16, a Wi-Fi interface 20, a BT(abbreviation for Bluetooth (registered trademark)) interface 22, and acontroller 30. Each of the units 12 to 30 is connected to a bus line(reference sign omitted).

The operation unit 12 comprises a plurality of keys. A user can inputvarious instructions into the printer PR by operating the operation unit12. The display unit 14 is a display for displaying various information.The display unit 14 also functions as a so-called touch panel. That is,the display unit 14 also functions as an operation unit operated by theuser. The print performing unit 16 is a printing mechanism such as aninkjet system or laser system.

The Wi-Fi I/F 20 is an I/F for performing a wireless communicationaccording to a Wi-Fi scheme (hereinafter called “Wi-Fi communication”).The Wi-Fi scheme, for example, is a wireless communication scheme basedon The Institute of Electrical and Electronics Engineers, Inc. (IEEE)standard 802.11, and standards conforming thereto (e.g. 802.11a, 11b,11g, 11n, and so forth). More specifically, the Wi-Fi I/F 20 supports aWFD (abbreviation of Wi-Fi Direct (registered trademark)) schemeformulated by a Wi-Fi Alliance. The WFD scheme is a wirelesscommunication scheme described in a “Wi-Fi Peer-to-Peer (P2P) TechnicalSpecification Version 1.1” prepared by the Wi-Fi Alliance.

The BT I/F 22 is an I/F for performing a wireless communication(hereinafter called “BT communication”) according to a Bluetooth scheme.The Bluetooth scheme, for example, is a wireless communication schemebased on IEEE standard 802.1.5, and standards conforming thereto. Morespecifically, the BT I/F 22 supports BLE (abbreviation of Bluetooth LowEnergy). The BLE is a standard that is realized using version 4.0 or alater version of the Bluetooth scheme. Hereinafter, Bluetooth versionlower than 4.0 will be called “classic BT”. In order for a BTcommunication to be performed according to BLE between a pair of BTI/Fs, the one BT I/F may support “Bluetooth Smart Ready” establishedusing the BT scheme, and the other BT I/F may support “Bluetooth SmartReady” or “Bluetooth Smart” established using the BT scheme. A BT I/Fthat supports “Bluetooth Smart Ready” is an I/F that is capable ofperforming both a BLE operation and a classic BT operation (i.e. aso-called dual mode I/F). A BT I/F that supports “Bluetooth Smart” is anI/F that is capable of performing a BLE operation, but is not capable ofperforming a classic BT operation. In the present embodiment, a BTcommunication according to BLE is performed between the printer PR andthe portable terminals PT1 and PT 2. Then, since the BT I/F (e.g.reference sign 62) of the portable terminals PT1 and PT 2, which will beexplained below, supports “Bluetooth Smart Ready”, the BT I/F 22 of theprinter PR may support whichever of “Bluetooth Smart Ready” and“Bluetooth Smart”. However, in a variation, the BT I/F of the portableterminals PT1 and PT 2 may support “Bluetooth Smart” when the BT I/F 22of the printer PR supports “Bluetooth Smart Ready”.

The points of difference between classic BT and BLE will be described.The number of BLE channels (i.e. 40) is less than the number of classicBT channels (i.e. 79). Current consumption of a BLE (e.g. 15 mA) at thetime of a data communication is less than the current consumption of aclassic BT (e.g. 35 mA) at the time of a data communication. Therefore,BLE power consumption is lower than the power consumption of the classicBT. Also, an Advertise signal is used in BLE, but an Advertise signal isnot used in classic BT.

The points of difference between the Wi-Fi scheme and the BT scheme willbe described. The communication speed of a Wi-Fi communication (e.g. amaximum communication speed of 600 Mbps) is faster than thecommunication speed of a BT communication (e.g. maximum communicationspeed of 24 Mbps). The frequency of the carrier wave in a Wi-Ficommunication is either a 2.4 GHz range or a 5.0 GHz range. Thefrequency of the carrier wave in a BT communication is the 2.4 GHzrange. That is, in a case where the 5.0 GHz range is used as the carrierwave frequency in a Wi-Fi communication, the carrier wave frequency inthe Wi-Fi communication differs from the carrier wave frequency in theBT communication. Furthermore, the maximum distance over which a Wi-Ficommunication can be performed (e.g. approximately 100 m) is greaterthan the maximum distance over which a BT communication can be performed(e.g. roughly several tens of meters).

The controller 30 comprises a CPU 32 and a memory 34. The CPU 32performs various processes in accordance with a program 36 stored in thememory 34. The memory 34 is configured by a volatile memory and anonvolatile memory. The memory 34 stores a BT device name “NP” of theprinter PR and a sending flag 38. The BT device name “NP” is a uniquename allocated to the BT I/F 22, in other words, it is a name that isused as information for identifying the printer PR in order for theprinter PR to perform the BT communication. The sending flag 38indicates “ON” in a case where the BT device name “NP” has been sent toan exterior, and indicates “OFF” in a case where the BT device name “NP”has not been sent to the exterior. FIG. 1 shows that the memory 34comprises an area 40, and the area 40 is used in a third embodiment,which will be explained below.

(Configuration of Portable Terminals PT1 and PT 2)

The portable terminals PT1 and PT 2, for example, are portable terminaldevices such as mobile telephones (e.g. smart phones), PDAs, notebookPCs, tablet PCs, portable music players, and portable video players. Theconfiguration of the portable terminal PT1 will be explained below, butportable terminal PT 2 comprises the same configuration as that ofportable terminal PT1.

The portable terminal PT1 comprises an operation unit 52, a display unit54, a Wi-Fi I/F 60, a BT I/F 62, and a controller 70. Each of the units52 to 70 is connected to a bus line (reference sign omitted).

The operation unit 52 comprises a plurality of keys. A user can inputvarious instructions into the portable terminal PT1 by operating theoperation unit 52. The display unit 54 is a display for displayingvarious information. The display unit 54 also functions as a so-calledtouch panel (i.e. also functions as an operation unit). The Wi-Fi I/F 60is an I/F for performing a Wi-Fi communication. The Wi-Fi I/F 60 may ormay not support WFD. The BT I/F 62 is an I/F for performing a BTcommunication, and supports BLE. The differences between the respectiveI/Fs 60 and 62 are the same as the differences between the respectiveI/Fs 20 and 22 of the printer PR.

The controller 70 comprises a CPU 72 and a memory 74. The CPU 72performs various processes in accordance with an OS program 76 stored inthe memory 74. The memory 74 is configured by a volatile memory and anonvolatile memory. The memory 74 not only stores the OS program 76, butalso a printer application 78. The printer application 78 is anapplication for causing a print function to be performed on the printerPR. The printer application 78 is started by the user when the userwishes to cause a print function to be performed on the printer PR. Theapplication 78, for example, may be installed in the portable terminalPT1 from an Internet server provided by the vendor of the printer PR, ormay be installed in the portable terminal PT1 from storage media shippedtogether with the printer PR.

The memory 74 also stores a BT device name “N1” of the portable terminalPT1. The BT device name “N1” is a unique name allocated to the BT I/F62, in other words, it is a name used as information for identifying theportable terminal PT1 in order for the portable terminal PT1 to performa BT communication. Furthermore, the portable terminal PT 2 has the BTdevice name “N2”, which differs from the BT device name “N1”. The memory74 comprises a BT device name storing area 80. The BT device namestoring area 80 is an area for storing a BT device name of a printerwith which a wireless connection, that is, a wireless connectionaccording to the Wi-Fi scheme, has been established via the Wi-Fi I/F60.

(Wi-Fi I/F Relation Process of Printer PR; FIG. 2)

Next, a Wi-Fi I/F relation process performed by the CPU 32 of theprinter PR will be explained by referring to FIG. 2. The Wi-Fi I/Frelation process is a process related primarily to the Wi-Fi I/F 20. TheCPU 32 commences the process of FIG. 2 when the power supply of theprinter PR is turned ON.

In S2, the CPU 32 generates SSID (abbreviation of a service setidentifier) by randomly generating a character string. Then, the CPU 32causes the SSID to be stored in the memory 34. The SSID is an identifierfor identifying a wireless network for performing a Wi-Fi communication.

In S4, the CPU 32 shifts the Wi-Fi I/F 20 from the OFF state to the ONstate. As used here, the OFF state of the Wi-Fi I/F 20 is a state inwhich power is not being supplied to the Wi-Fi I/F 20, that is, a statein which a Wi-Fi communication cannot be performed. The ON state of theWi-Fi I/F 20 is a state in which power is being supplied to the Wi-FiI/F 20, that is, a state in which a Wi-Fi communication can beperformed.

In S4, the CPU 32 spontaneously causes the operating state of theprinter PR to shift from a device state of WFD to a G/O (abbreviation ofgroup owner) state without performing a WFD G/O negotiation. When in theG/O state, the printer PR sends a beacon signal via the Wi-Fi I/F 20 toinform surrounding apparatuses of its existence. On the other hand, whenin a state other than the G/O state (e.g. the aforementioned devicestate or a client state), the printer PR does not send a beacon signal.Thus, the power consumption of the printer PR when in the G/O state ishigher than the power consumption of the printer PR when in a stateother than the G/O state.

Next, the CPU 32 sequentially performs monitoring processes of S10 andS40. In S10, the CPU 32 monitors for a Wi-Fi connection operation to beperformed by the user on either the operating unit 12 or the displayunit 14 (i.e. the touch panel) of the printer PR. The Wi-Fi connectionoperation is an operation for establishing a wireless connectionaccording to the Wi-Fi scheme (hereinafter called “Wi-Fi connection”)between the printer PR and the portable terminal (e.g. PT1). The Wi-Ficonnection operation is performed by the user of the portable terminalfor which a Wi-Fi connection has not been established with the printerPR in the past. The CPU 32 determines YES in S10 when the Wi-Ficonnection operation is performed, and proceeds to S12.

In S12, the CPU 32 obtains the SSID from the memory 34, and causes thedisplay unit 14 to display the obtained SSID. This makes it possible forthe user to find out the SSID required for establishing a Wi-Ficonnection with the printer PR by looking at the display unit 14.Furthermore, as described above, the SSID is stored in the memory 34 inS2. However, when S34 or S56, which will be described below, areperformed after S2 was performed, a new SSID is stored in the memory 34in place of an old SSID in the memory 34. Therefore, in a situation inwhich neither S34 nor S56 has been performed after S2 was performed, theSSID displayed in S12 is the SSID that was generated in S2. In asituation in which either S34 or S56 has been performed after S2 wasperformed, the SSID displayed in S12 is a new SSID that was generated ineither S34 or S56. Hereinafter, the SSID currently stored in the memory34 will be called “current SSID”.

In S14, the CPU 32 determines whether or not a Probe Request signal(hereinafter written as “Probe_Req signal”) has been received from theportable terminal via the Wi-Fi I/F 20. The Probe_Req signal is abroadcast transmission signal from the portable terminal, and morespecifically, is a signal for searching for a G/O state apparatus and anAP that exist around the portable terminal. The CPU 32 determines YES inS14 when the Probe_Req signal has been received, and proceeds to S16. Onthe other hand, the CPU 32 determines NO in S14 when a Probe_Req signalhas not been received during a predetermined period of time after S12has ended, skips S16 to S32, and proceeds to S34.

In S16, the CPU 32 sends a Probe Response signal (hereinafter written as“Probe_Res signal”) including the current SSID to a portable terminalvia the Wi-Fi I/F 20. The Probe_Res signal is a response signal to theProbe_Req signal. The portable terminal, upon receiving the Probe_Ressignal, displays the SSID included in the Probe_Res signal on thedisplay unit of the portable terminal. At this point, the user of theportable terminal is able to ascertain that the SSID being displayed onthe display unit of the portable terminal is a SSID of which apparatusby comparatively checking the SSID being displayed on the display unitof the portable terminal to the SSID that was displayed on the displayunit 14 of the printer PR in S12 described above, and may select thecurrent SSID of the printer PR. This makes it possible for the user toinstruct the portable terminal to send a Wi-Fi connection requestsignal, which will be explained below.

In S18, the CPU 32 determines whether or not a Wi-Fi connection requestsignal including the current SSID has been received from the portableterminal via the Wi-Fi I/F 20. The Wi-Fi connection request signal is asignal for requesting the printer PR to establish a Wi-Fi connection,and more specifically, is an Association Request signal. The CPU 32determines YES in S18 when a Wi-Fi connection request signal includingthe current SSID has been received, and proceeds to S20. On the otherhand, the CPU 32 determines NO in S18 when a Wi-Fi connection requestsignal including the current SSID has not been received during apredetermined period of time after S16 has ended, skips S20 to S32, andproceeds to S34.

In S20, the CPU 32 establishes a wireless connection via the Wi-Fi I/F20 (i.e. a Wi-Fi connection) with the portable terminal. Specifically,the CPU 32 performs a communication with the portable terminal via theWi-Fi I/F 20 using various types of signals (e.g. sends an AssociationResponse signal, communicates a 4-way Handshake, and so forth). The CPU32, in the process of communicating the aforementioned various types ofsignals, receives Wi-Fi setting information including the SSID and apassword from the portable terminal, and performs an authentication ofthe Wi-Fi setting information. The CPU 32 determines that theauthentication of the Wi-Fi setting information has been successful andestablishes a Wi-Fi connection with the portable terminal in a casewhere the received SSID is identical to the current SSID, and thereceived password is identical to a predetermined password. As usedhere, the predetermined password is a fixed character string that hasbeen set in the printer PR beforehand. That is, in the presentembodiment, when the power supply to the printer PR is turned ON andeither S34 or S56, which will be explained below, is performed, the SSIDchanges, but the password does not change.

As explained above, a Wi-Fi connection is established between theprinter PR and the portable terminal in S20. Consequently a wirelessnetwork of Wi-Fi-scheme (hereinafter written as “Wi-Fi network”) inwhich the printer PR operates in the G/O state and the portable terminaloperates as a so-called legacy, is formed. Legacy signifies an apparatusthat participates in the Wi-Fi network without performing a WFDoperation. Since the printer PR that is in the G/O state manages a Wi-Finetwork, printer PR that is the G/O-state can be called a parent station(in other words, a master device) of the Wi-Fi network. Also, since theportable terminal participates in the Wi-Fi network as a legacy, thelegacy portable terminal can be called a child station (in other words,a slave device) of the Wi-Fi network.

In S24, the CPU 32 uses the Wi-Fi network (i.e. uses the Wi-Ficonnection) so as to send the printer PR BT device name “NP” in thememory 34 to the portable terminal via the Wi-Fi I/F 20.

In S26, the CPU 32 determines whether or not the sending flag 38 in thememory 34 indicates “OFF”. In a case where it is determined that thesending flag 38 indicates “OFF” (YES in S26), in S28, the CPU 32 changesthe sending flag 38 to “ON” and proceeds to S30. On the other hand, in acase where it is determined that the sending flag 38 indicates “ON” (NOin S26), the CPU 32 skips S28, and proceeds to S30.

In S30, the CPU 32 uses the Wi-Fi network so as to receive print datarepresenting an image to be printed from the portable terminal via theWi-Fi I/F 20. Then, the CPU 32 supplies the print data to the printperforming unit 16, and causes the print performing unit 16 to print inaccordance with the print data.

In S32, the CPU 32 uses the Wi-Fi network so as to receive adisconnection signal from the portable terminal via the Wi-Fi I/F 20.The disconnection signal is a signal for requesting the disconnection ofthe Wi-Fi connection. As a result of this, the Wi-Fi connection betweenthe printer PR and the portable terminal is disconnected.

In S34, the CPU 32 generates a new SSID, and causes the new SSID to bestored in the memory 34 in place of an old SSID in the memory 34. Thatis, the CPU 32 changes the SSID. Therefore the security of the Wi-Finetwork may be enhanced since the SSID changes. When S34 ends, the CPU32 returns to S10.

In S40, the CPU 32 monitors for the receiving of the Wi-Fi connectionrequest signal including the current SSID from the portable terminal viathe Wi-Fi I/F 20 without the Wi-Fi connection operation being performed(NO in S10). In a case where the Wi-Fi connection request signalincluding the current SSID is received, the CPU 32 determines YES inS40, and proceeds to S50. S50, S52, S54, and S56, respectively, are thesame as S20, S30, S32, and S34. When S56 ends, the CPU 32 returns toS10.

(BT I/F Relation Process of Printer PR; FIG. 3)

Next, a BT I/F relation process performed by the CPU 32 of the printerPR will be explained by referring to FIG. 3. The BT I/F relation processis a process related primarily to the BT I/F 22. The CPU 32 starts theprocess of FIG. 3 when the power supply to the printer PR is turned ON.

In S70, the CPU 32 determines whether or not the BT I/F 22 is in the OFFstate. The CPU 32 determines YES in S70 and proceeds to S72 in a casewhere the CPU 32 inquires the state of the BT I/F 22 of the BT I/F 22and obtains information indicating the OFF state from the BT I/F 22, andCPU 32 determines NO in S70 and proceeds to S80 in a case where the CPU32 obtains information indicating the ON state from the BT I/F 22. Here,the OFF state of the BT I/F 22 is a state in which power is not suppliedto the BT I/F 22, that is, a state in which a BT communication cannot beperformed. The ON state of the BT I/F 22 is a state in which power isbeing supplied to the BT I/F 22, that is, a state in which a BTcommunication can be performed. The power consumption (i.e. the powerconsumption of the BLE) of the BT I/F 22 in the ON state is lower thanthe power consumption of the Wi-Fi I/F 20 in the ON state.

In S72, the CPU 32 determines whether or not the sending flag 38 in thememory 34 indicates “ON”. In a case where it is determined that thesending flag 38 indicates “ON” (YES in S72), in S74, the CPU 32 shiftsthe BT I/F 22 from the OFF state to the ON state. The BT I/F 22 can beset to the OFF state until the BT I/F 22 is shifted to the ON state inS74, thereby making it possible to reduce the power consumption of theprinter PR. In a case where it is determined that the sending flag 38indicates “OFF” (NO in S72), the CPU 32 skips S74, and returns to S70.

In S80 (i.e. the BT I/F 22 is in the ON state), first, the CPU 32obtains the BT device name “NP” of the printer PR, the current SSID, anda predetermined password from the memory 34. Then, the CPU 32 performs abroadcast transmission of the Advertise signal including the obtainedrespective types of information via the BT I/F 22. The broadcasttransmission here is a signal of which destination is not specified.That is, the Advertise signal includes the BT device name “NP” asinformation indicating its source (sender), but does not includeinformation indicating its destination. The Advertise signal is a signalfor notifying apparatuses around the printer PR of the printer'sexistence. In particular, the CPU 32 sends the Advertise signal to theexterior without establishing a Bluetooth logical link (i.e. aBluetooth-scheme wireless connection). More specifically, in a Bluetoothprotocol stack, the signal is sent to the exterior by a communication ofa layer lower than a L2CAP layer (i.e. Link Manager layer or Link Layerlayer), being performed without a communication of a layer higher thanor equal to the L2CAP layer being performed. The L2CAP layer is ahighest layer for establishing a Bluetooth logical link. That is, theAdvertise signal is sent to the exterior by a communication of a lowerlayer which is lower than the highest layer for establishing a logicallink being performed without a communication of the highest layer beingperformed.

When S80 ends, the CPU 32 returns to S70. Then, in a case where S80 isperformed again following a NO in S70, the CPU 32 once again performs abroadcast transmission of the Advertise signal. That is, the CPU 32repeats the broadcast transmission of the Advertise signal.

(Process of Portable Terminal PT1; FIG. 4)

Next, a process performed by the CPU 72 of the portable terminal PT1will be explained by referring to FIG. 4. Notably, a portable terminalPT2 is capable of performing the same process. When an operation foractivating the printer application 78 is performed on the portableterminal PT1, the CPU 72 starts the process of FIG. 4 in accordance withthe printer application 78. Furthermore, operations related to theportable terminal PT1 may be performed on the operation unit 52 or onthe display unit 54 (i.e. the touch panel). The same holds true hereinbelow as well.

The CPU 72 repeats sequential performing of monitor processes of S100and S140. In S100, the CPU 72 monitors for the Wi-Fi connectionoperation to be performed on the portable terminal PT1 by the user. TheWi-Fi connection operation is normally performed by the user of theportable terminal for which a Wi-Fi connection to the printer PR has notbeen established in the past. In a case where the Wi-Fi connectionoperation is performed, the CPU 72 determines YES in S100, and proceedsto S102.

In S102, the CPU 72 performs a broadcast transmission of the Probe_Reqsignal via the Wi-Fi I/F 60. The Probe_Req signal may be received by theprinter PR if a distance between the printer PR and the portableterminal PT1 is shorter than a distance over which a Wi-Fi communicationcan be performed (refer to YES in S14 of FIG. 2).

In S104, the CPU 72 determines whether or not the Probe_Res signal hasbeen received via the Wi-Fi I/F 60. The CPU 72 receives the Probe_Ressignal from the printer PR in a case where the printer PR is operatingin the G/O state (refer to S16 of FIG. 2). Also, in a case where an AP(abbreviation of Access Point) exists in the vicinity of the portableterminal PT1, the CPU 72 receives the Probe_Res signal from the AP. Whenone or more Probe_Res signals are received, the CPU 72 determines YES inS104, and proceeds to S106. On the other hand, in a case where noProbe_Res signal has been received during a predetermined time periodafter S102 ends, the CPU 72 determines NO in S104, skips S106 to S120,and returns to S100.

In S106, the CPU 72 causes one or more SSIDs included in the receivedone or more Probe_Res signals to be displayed on the display unit 54.The user may perform an operation on the portable terminal PT1 forselecting the current SSID (refer to S12 of FIG. 2) displayed on theprinter PR among the one or more SSIDs. That is, the user is able toselect the current SSID from among the abovementioned one or more SSIDsby comparing the abovementioned one or more SSIDs to the current SSIDdisplayed on the display unit 14 of the printer PR in S12 of FIG. 2described above.

In S108, the CPU 72 determines whether or not an operation for selectingone SSID among the one or more SSIDs displayed in S106 has beenperformed on the portable terminal PT1 by the user. In a case where theoperation for selecting the SSID has been performed, the CPU 72determines YES in S108, and proceeds to S110. In FIG. 4, processes ofS110 to S120 are described on a premise that the current SSID of theprinter PR is selected. On the other hand, in a case where the operationfor selecting an SSID is not performed, that is, in a case where acancel is instructed by the user, the CPU 72 determines NO in S108,skips S110 to S120, and returns to S100.

In S110, the CPU 72 causes a password input screen to be displayed onthe display unit 54. For example, an administrator of the printer PRbeforehand notifies the user of the portable terminal PT1 of apredetermined password of the printer PR. Due to this, the user mayperform an operation for inputting the predetermined password on theportable terminal PT1. When the operation is performed, the processingproceeds to S112.

In S112, the CPU 72 sends the Wi-Fi connection request signal includingthe SSID selected in S108 (i.e. the current SSID of the printer PR) tothe printer PR via the Wi-Fi I/F 60. The Wi-Fi connection request signalmay be received by the printer PR (refer to YES in S18 of FIG. 2).

In S114, the CPU 72 establishes a wireless connection via the Wi-Fi I/F60 (i.e. the Wi-Fi connection) with the printer PR. Specifically, theCPU 72 performs communications using various types of signals (e.g.receiving an Association Response signal, communicating a 4-WayHandshake, and so forth) with the printer PR via the Wi-Fi I/F 60. In acourse of communications using the abovementioned various types ofsignals, the CPU 72 sends Wi-Fi setting information, which includes theSSID selected in S108 and the password inputted in S110, to the printerPR. In a case where an authentication of the Wi-Fi setting informationis successful in the printer PR, the Wi-Fi connection with the printerPR is established. Consequently, there is formed a Wi-Fi network inwhich the printer PR operates in the G/O state, and the portableterminal PT1 operates as a legacy (refer to S20 of FIG. 2).

In S116, the CPU 72 uses the Wi-Fi network (i.e. uses the Wi-Ficonnection) so as to receive the BT device name “NP” of the printer PRfrom the printer PR via the Wi-Fi I/F 60 (refer to S24 of FIG. 2). Then,the CPU 72 causes the received BT device name “NP” to be stored in theBT device name storing area 80. Consequently, the BT device name of aprinter for which the Wi-Fi connection with the portable terminal PT1has been established (hereinafter called “connection-establishedprinter”) is stored in the BT device name storing area 80.

In S118, the CPU 72 uses the Wi-Fi network so as to send print data tothe printer PR via the Wi-Fi I/F 60. This makes it possible to cause theprinter PR to perform printing of an image represented by the print data(refer to S30 of FIG. 2). The print data is an image file designated bythe user from among one or more image files stored in the memory 74 ofthe portable terminal PT1. The designation of the image file being aprinting target here, for example, may be performed immediatelyfollowing the activation of the printer application 78, may be performedafter the password has been inputted in S110, or may be performed afterthe Wi-Fi connection with the printer PR has been established in S114.

In S120, in a case where the sending of the print data to the printer PRis complete, the CPU 72 uses the Wi-Fi network so as to send adisconnection signal to the printer PR via the Wi-Fi I/F 60. As aresult, the Wi-Fi connection between the printer PR and the portableterminal PT1 is disconnected (refer to S32 of FIG. 2). When S120 ends,the CPU 72 returns to S100.

In S140, the CPU 72 monitors for the receiving of the Advertise signalvia the BT I/F 62. As described above, in a case where the sending flag38 indicates ON, the printer PR repeats the broadcast transmission ofthe Advertise signal including the BT device name “NP”, the currentSSID, and the predetermined password (refer to S80 of FIG. 3).Therefore, if the distance between the printer PR and the portableterminal PT1 is shorter than the maximum distance over which it ispossible to perform a BT communication, the CPU 72 receives theAdvertise signal from the printer PR via the BT I/F 62. In this case,the CPU 72 determines YES in S140, and proceeds to S142.

In S142, the CPU 72 determines whether or not the BT device name in thereceived Advertise signal (i.e. the received BT device name) is storedin the BT device name storing area 80. As described above, the BT devicename storing area 80 stores the BT device name of theconnection-established printer (refer to S116). Therefore, thedetermination of S142 signifies determination whether or not the printerPR which is the source of the Advertise signal is theconnection-established printer. In a case where it is determined thatthe received BT device name is stored in the BT device name storing area80 (YES in S142), the CPU 72 proceeds to S148. In FIG. 4, processes ofS148 to S154 are depicted on a premise that the BT device name “NP” ofthe printer PR is stored in the BT device name storing area 80. On theother hand, in a case where it is determined that the received BT devicename is not stored in the BT device name storing area 80 (NO in S142),the CPU 72 skips S148 to S154, and returns to S100.

In S148, the CPU 72 sends the Wi-Fi connection request signal includingthe current SSID in the received Advertise signal to the printer PR viathe Wi-Fi I/F 60. Due to this, the Wi-Fi connection request signal maybe received by the printer PR (refer to YES in S40 of FIG. 2). Thus, asusing the receiving of the Advertise signal from the printer PR as atrigger, the CPU 72 sends the Wi-Fi connection request signal to theprinter PR. Therefore, the Advertise signal may be called a triggersignal for sending the Wi-Fi connection request signal to the printerPR.

In S150, the CPU 72 established the Wi-Fi connection with the printer PRin the same way as in S114. Here, the CPU 72 establishes the Wi-Ficonnection with the printer PR using the Wi-Fi setting informationincluding the current SSID and the password in the received Advertisesignal. S152 and S154, respectively, are the same as S118 and S120. WhenS154 ends, CPU 72 returns to S100.

(Specific Cases)

Next, specific cases realized by the processes of FIGS. 2 to 4 will beexplained by referring to FIGS. 5 and 6. In FIGS. 5 and 6, thick linearrows and thin line arrows between the printer PR and the portableterminals PT1 and PT2 respectively indicate Wi-Fi communications and BTcommunications.

(Case A; FIG. 5)

In an initial state of a case A, the power supply to the printer PR isOFF. Also, the portable terminal PT1 has not established the Wi-Ficonnection with the printer PR in the past. That is, the BT device name“NP” of the printer PR is not stored in the BT device name storing area80 of the portable terminal PT1. Furthermore, no BT device names ofprinter PR are stored in the BT device name storing area 80.

In A0, the power supply to the printer PR is turned ON by the user. Inthis case, the printer PR generates an SSID “X1” in T2 (S2 of FIG. 2),and in T4, shifts the Wi-Fi I/F 20 to the ON state, and shifts to theG/O state (S4). Next, in A1, the Wi-Fi connection operation is performedon the printer PR by the user of the portable terminal PT1 (YES in S10).In this case, in T10, the printer PR displays the SSID “X1” (S12).

In A2, an operation for activating the printer application 78 and theWi-Fi connection operation are performed on the portable terminal PT1 bythe user (YES in S100 of FIG. 4). In this case, in T20 the portableterminal PT1 performs a broadcast transmission of the Probe_Req signal(S102).

The printer PR, in a case where the Probe_Req signal is received fromthe portable terminal PT1 (YES in S14 of FIG. 2), in T22, sends theProbe_Res signal including the SSID “X1” to the portable terminal PT1(S16). Furthermore, if the operation of A2 is not performed on theportable terminal PT1, the Probe_Req signal is not sent from theportable terminal PT1, and as a result, the printer PR determines NO inS14 of FIG. 2.

The portable terminal PT1, in a case where the Probe_Res signal isreceived from the printer PR (YES in S104 of FIG. 4), in T30, displaysthe SSID “X1” included in the Probe_Res signal (S106). Furthermore, in acase where the portable terminal PT1 further receives a Probe_Res signalfrom a different apparatus than the printer PR, the portable terminalPT1 displays not only the SSID “X1”, but also a SSID included in thatProbe_Res signal. That is, in T30, the portable terminal PT1 displaysone or more SSIDs including the SSID “X1”. At this point, by comparingthe one or more SSIDs displayed on the portable terminal PT1 to the SSID“X1” displayed on the printer PR in the above-described T10, the usercan confirm the SSID “X1” of the printer PR from among theaforementioned one or more SSIDs.

In A3, an operation for selecting the SSID “X1” from among the one ormore SSIDs is performed on the portable terminal PT1 by the user (YES inS108 of FIG. 4). In this case, in T32, the portable terminal PT1displays the password input screen (S110). In A4, an operation forinputting the password “PS” of the printer PR is performed on theportable terminal PT1 by the user. In this case, in T40, the portableterminal PT1 sends the Wi-Fi connection request signal including theSSID “X1” selected in A3 to the printer PR. Furthermore, in a case whereeither the SSID “X1” is not selected in A3, or a cancel is performedwithout inputting a password in A4, the Wi-Fi connection request signalis not sent from the portable terminal PT1, and as a result, the printerPR determines NO in S18 of FIG. 2.

When the Wi-Fi connection request signal is sent to the printer PR fromthe portable terminal PT1, in T42, a Wi-Fi connection is establishedbetween the printer PR and the portable terminal PT1 (S20 of FIG. 2, andS114 of FIG. 4). Herein, in the process of T42, the printer PR receivesthe Wi-Fi setting information including the SSID “X1” and the password“PS” from the portable terminal PT1, and performs an authentication ofthe Wi-Fi setting information, and because the authentication issuccessful in this case, establishes the Wi-Fi connection with theportable terminal PT1. Consequently, a Wi-Fi network in which theprinter PR operates as a parent station and the portable terminal PT1operates as a child station is formed.

After establishing the Wi-Fi connection with the portable terminal PT1,in T44, the printer PR uses the Wi-Fi connection so as to send the BTdevice name “NP” of the printer PR to the portable terminal PT1 (S24 ofFIG. 2). Then, the printer PR changes the sending flag 38 to “ON” (YESin S26, and S28), and as a result, in T46, shifts the BT I/F 22 from theOFF state to the ON state (YES in S70, YES in S72, and S74 of FIG. 3).

The portable terminal PT1, in a case where the BT device name “NP” isreceived from the printer PR, in T50, stores the BT device name “NP”(S116 of FIG. 4). Next, in T60, the portable terminal PT1 uses the Wi-Ficonnection so as to send print data to the printer PR (S118).

The printer PR, in a case where the print data is received from theportable terminal PT1, in T62, performs a print process according to theprint data (S30 of FIG. 2). Furthermore, a configuration in which theprinter PR receives the print data from the portable terminal PT1 usinga BT communication is conceivable. However, there is a possibility thatthe print data may be large in size, and, in addition, the communicationspeed of a BT communication may be slower than the communication speedof a Wi-Fi communication. Therefore, in a case that employs theconfiguration in which a BT communication is used to communicate theprint data, the print data communication may take a long time. Bycontrast, in the present embodiment, a Wi-Fi communication is used tocommunicate the print data, thereby making it possible to communicatethe print data quickly.

The portable terminal PT1, after sending the print data to the printerPR, in T70, sends a disconnection signal for disconnecting the Wi-Ficonnection to the printer PR (S120 of FIG. 4). Consequently, the W-Ficonnection between the printer PR and the portable terminal PT1 isdisconnected.

The printer PR, after receiving the disconnection signal from theportable terminal PT1 (S32 of FIG. 2), in T72, generates an SSID “X2”that differs from the SSID “X1” (S34).

(Case B1; FIG. 6)

A case B1 of FIG. 6 is a continuation of the case A of FIG. 5, the Wi-FiI/F 20 of the printer PR is in the ON state (refer to T4 of FIG. 5), andthe BT I/F 22 is in the ON state (refer to T46). Also, the BT devicename “NP” of the printer PR, which is the connection-establishedprinter, is stored in the BT device name storing area 80 of the portableterminal PT1 (refer to T50).

In T100, the printer PR repeats the broadcast transmission of theAdvertise signal (S80 of FIG. 3). The Advertise signal includes the BTdevice name “NP” of the printer PR as information indicating the sourceof the signal, and, in addition, includes the SSID “X2” and the password“PS”.

As described above, in a case where the sending flag 38 indicates “ON”,that is, in a case where the BT device name “NP” has been sent to theexterior at least one time, the BT I/F 22 is in the ON state (refer toT46 of FIG. 5), and the printer PR repeats sending of the Advertisesignal (T100). On the other hand, in a case where the sending flag 38indicates “OFF”, that is, in a case where the BT device name “NP” hasnever been sent to the exterior, the BT I/F 22 is maintained in the OFFstate, and the printer PR does not send the Advertise signal (YES inS70, and NO in S72 of FIG. 3). The printer PR is able to realize powersaving because of this.

In A10, an operation for activating the printer application 78 isperformed on the portable terminal PT1 by the user (trigger of processof FIG. 4). In this case, the portable terminal PT1 receives theAdvertise signal from the printer PR (YES in S140), and in T102,determines that the BT device name “NP” included in the Advertise signalis stored in the BT device name storing area 80 (YES in S142). Then, inT120, the portable terminal PT1 sends the Wi-Fi connection requestsignal including the SSID “X2” in the Advertise signal to the printer PR(S148). Thus, the portable terminal PT1 sends the Wi-Fi connectionrequest signal to the printer PR without displaying a screen forselecting an SSID (refer to T30 of FIG. 5) and a screen for inputting apassword (refer to T32). Therefore, the user can easily establish Wi-Ficonnection for a second time and onward between the printer PR and theportable terminal PT1.

When the Wi-Fi connection request signal is sent from the portableterminal PT1 to the printer PR, in T122, a Wi-Fi connection isestablished between the printer PR and the portable terminal PT1 (S50 ofFIG. 2, and S150 of FIG. 4). T130, T132, T140, and T142, which areperformed after T122, are the same as T60, T62, T70, and T72,respectively, of FIG. 5 (S52 to S56 of FIG. 2, and S152 and S154 of FIG.4). Furthermore, in T142, an SSID “X3”, which differs from the SSIDs“X1” and “X2”, is generated.

(Case B2)

A case B2 is also a continuation of the case A. The BT device name “NP”of the printer PR is not stored in a BT device name storing area(omitted from the drawing) of the portable terminal PT2.

In T150, the printer PR repeats sending of the Advertise signal the sameway as in T100 (S80 of FIG. 3). In A20, an operation for activating aprinter application is performed on the portable terminal PT2 by theuser (trigger of process of FIG. 4). In this case, the portable terminalPT2 receives the Advertise signal from the printer PR (YES in S140 ofFIG. 4), but in T152, determines that the BT device name “NP” in theAdvertise signal is not stored in the BT device name storing area (NO inS142). As a result, the portable terminal PT2 does not send the Wi-Ficonnection request signal to the printer PR. Hypothetically, the sameoperations A1, A2 and so forth as the case A of FIG. 5 need to beperformed on the printer PR and the portable terminal PT2 in order tocause a Wi-Fi connection to be established between the printer PR andthe portable terminal PT2.

(Effects of First Embodiment)

The printer PR performs the BT communication and repeats the broadcasttransmission of the Advertise signal (T100 of FIG. 6). Consequently, theAdvertise signal is received by the portable terminal PT1, the Wi-Ficonnection request signal is sent from the portable terminal PT1 to theprinter PR (T120), and the Wi-Fi connection is established between theprinter PR and the portable terminal PT1 (T122). Thus, the printer PRand the portable terminal PT1 can appropriately form the Wi-Fi networkafter performing the BT communication, and as a result, can use theWi-Fi network to appropriately perform the print data communication.

Also, in the present embodiment, the BT communication is performedbetween the printer PR and the portable terminal PT1, but there is noneed to establish the logical link of the BT scheme (i.e. the BT-schemewireless connection) between the printer PR and the portable terminalPT1. Therefore, since there is no need to communicate the signal forestablishing the logical link of the BT scheme between the printer PRand the portable terminal PT1, the processing load between the printerPR and the portable terminal PT1 may be lessened. Also, since the Wi-Fisetting information including the SSID and the password of the printerPR is included in the Advertise signal, there is no need to perform theBT communication of the Wi-Fi setting information subsequent to the BTcommunication of the Advertise signal between the printer PR and theportable terminal PT1. In this respect as well, the processing loadbetween the printer PR and the portable terminal PT1 may be lessened.

Also, in the present embodiment, in a case where the portable terminalPT1 is storing the BT device name “NP” of the printer PR, that is, in acase where the portable terminal PT1 has established the Wi-Ficonnection with the printer PR in the past, the Wi-Fi connection requestsignal is sent from the portable terminal PT1 to the printer PR that isthe connection-established printer (refer to the case B1 of FIG. 6).Consequently, the Wi-Fi connection is established between the printer PRand the portable terminal PT1 even though the Wi-Fi connection operationhas not been performed on the printer PR and the portable terminal PT1.The user of the portable terminal PT1 can easily establish the Wi-Ficonnection with the connection-established printer.

On the other hand, in a case where the portable terminal PT2 is notstoring the BT device name “NP” of the printer PR, that is, in a casewhere the portable terminal PT2 has not established the Wi-Fi connectionwith the printer PR in the past, the Wi-Fi connection request signal isnot sent from the portable terminal PT2 to the printer PR (refer to thecase B2 of FIG. 6). Then, in order to establish the Wi-Fi connectionbetween the printer PR and the portable terminal PT2, the Wi-Ficonnection operation needs be performed on the printer PR and theportable terminal PT2 (refer to A1 and A2 of FIG. 5), and, in addition,the operation for selecting the SSID and the operation for inputting thepassword need to be performed on the portable terminal PT2 (refer to A3and A4 of FIG. 5). This, for example, makes it possible to prevent theportable terminal PT2, which is not permitted by administrator of theprinter PR to use the printer PR, from establishing the Wi-Fi connectionwith the printer PR. The security of the printer PR can be enhancedbecause of this.

Also, the portable terminals PT1 and PT2 comprise the BT device namestoring area 80, determine whether or not the BT device name “NP” of theprinter PR is stored in the BT device name storing area 80 (S142 of FIG.4), and change processing subsequent thereto in accordance with thedetermination result. Therefore, the printer PR does not need to beprovided with a BT device name storing area, and, in addition, does notneed to perform the determination process. The processing load of theprinter PR may be reduced because of this.

(Corresponding Relationships)

The printer PR and the portable terminals PT1 and PT2, respectively, areexamples of the “first communication apparatus” and the “secondcommunication apparatus”. The BT device name “NP” is an example of the“first apparatus identification information”. When viewed from theprinter PR, the portable terminal PT1 is an example of the “thirdcommunication apparatus”. When viewed from the portable terminal PT1,the printer PR and the BT device name “NP”, respectively, are examplesof the “third communication apparatus” and “third apparatusidentification information”. The Wi-Fi scheme and the Wi-Fi I/Fs 20 and60, respectively, are examples of the “first communication scheme” andthe “first interface”. The BT scheme and the BT I/Fs 22 and 62,respectively, are examples of the “second communication scheme” and the“second interface”. The Advertise signal and the Wi-Fi connectionrequest signal, respectively, are examples of the “trigger signal” andthe “wireless connection request”. The OFF state and the ON state of theBT I/F 22, respectively, are examples of the “first state” and the“second state”. Also, the Wi-Fi connection established in T122 of FIG. 6and the Wi-Fi connection established in T42 of FIG. 5, respectively, areexamples of the “first wireless connection” and the “second wirelessconnection”. The SSID “X2” and the password “PS” in the Advertise signalof T100 of FIG. 6 are examples of the “network-related information”.

Second Embodiment

A second embodiment will be explained by focusing mainly on points ofdifference from the first embodiment. In the first embodiment, theAdvertise signal of which the broadcast transmission is performed fromthe printer PR includes the BT device name “NP” of the printer PR, thecurrent SSID, and the password (S80 of FIG. 3). In the presentembodiment, the Advertise signal includes the BT device name “NP”, butdoes not include the current SSID and the password. This point differsgreatly from the first embodiment.

(Wi-Fi I/F Related Process of Printer PR; FIG. 7)

In the present embodiment, a Wi-Fi I/F related process of FIG. 7 isperformed instead of that of FIG. 2. S2 is the same as S2 of FIG. 2. InFIG. 2, when S2 ends, S4 is performed, but in FIG. 7, when S2 ends, theprocessing advances to S10.

S10 is the same as S10 of FIG. 2. In the case of YES in S10, the CPU 32performs S11. S11 is the same as S4 of FIG. 2. S12 to S32, which areperformed subsequent thereto, are the same as S12 to S32 of FIG. 2. InS34A, the CPU 32 shifts the operating state of the printer PR from theG/O state to the device state (i.e. stops the G/O state). This makes itpossible to reduce the power consumption of the printer PR. In S34A, theCPU 32 also shifts the Wi-Fi I/F 20 from the ON state to the OFF state.This makes it possible to reduce the power consumption of the printerPR. In S34A, the CPU 32 also generates a new SSID, and causes the newSSID to be stored in the memory 34 in place of an old SSID in the memory34. When S34A ends, the CPU 32 returns to S10.

Also, in S40A, the CPU 32 monitors for obtaining of a predeterminednotice (refer to S90 of FIG. 3) from the BT I/F related process withoutthe Wi-Fi connection operation being performed (NO in S10). Hereinbelow,a portable terminal for which a Wi-Fi connection has been establishedwith the printer PR will be called “connection-established terminal”.The predetermined notice is a notice that is supplied to the Wi-Fi I/Frelated process from the BT I/F related process in a case where a ScanRequest signal is received from the connection-established terminal inaccordance with the BT communication. The CPU 32, in a case where thepredetermined notice is obtained, determines YES in 540A, and proceedsto S42.

S42 is the same as S11. In S44, the CPU 32 determines whether the Wi-Ficonnection request signal including the current SSID is received via theWi-Fi I/F 20 from the portable terminal that is theconnection-established terminal. The CPU 32, in a case where the Wi-Ficonnection request signal including the current SSID is received,determines YES in S44, and proceeds to S50. On the other hand, in a casewhere the Wi-Fi connection request signal including the current SSID isnot received during a predetermined time period after S42 ends, the CPU32 determines NO in S44, skips S50 to S54, and proceeds to S56A. S50 toS54 are the same as S50 to S54 of FIG. 2. S56A is the same as S34A. WhenS56A ends, the CPU 32 returns to S10.

(BT I/F Related Process of Printer PR; FIG. 3)

Next, contents of the BT I/F related process of the present embodimentwill be explained by referring to FIG. 3. S70 to S74 are the same as thefirst embodiment. In S80, the CPU 32 of the printer PR performs abroadcast transmission of the Advertise signal that includes the BTdevice name “NP” as information indicating its source. However, theAdvertise signal does not include the current SSID and the password.When S80 ends, the CPU 32 proceeds to S82.

In S82, the CPU 32 determines whether or not the Scan Request signal(hereinafter written as “Scan_Req signal”) has been received from theportable terminal via the BT I/F 22. The Scan_Req signal is a signalthat is sent from the portable terminal in a case where the portableterminal that received the Advertise signal is theconnection-established terminal. The Scan_Req signal is a unicastsignal, and includes the BT device name “NP” of the printer PR asinformation indicating its destination, and also includes the BT devicename of the portable terminal (e.g. the BT device name “N1” of theportable terminal PT1) as information indicating its source. TheScan_Req signal is a signal for requesting the printer PR for Wi-Fisetting information including the SSID and the password. In particular,the CPU 32 can receive the Scan_Req signal even without establishing alogical link. That is, the Scan_Req signal is received from the exteriorby a communication of a lower layer than a highest layer forestablishing the logical link being performed without performing acommunication of the highest layer. The CPU 32, in a case where theScan_Req signal is received, determines YES in S82, and proceeds to S90.On the other hand, in a case where the Scan_Req signal has not beenreceived during a predetermined time period after S80 ends, the CPU 32determines NO in S82, skips S90 and S92, and returns to S70.

In S90, the CPU 32 supplies the predetermined notice to the Wi-Fi I/Frelated process (refer to FIG. 7). Consequently, the Wi-Fi I/F 20 isshifted to the ON state, and the operating state of the printer PR isshifted to the G/O state (YES in 540A, and S42 of FIG. 7).

In S92, the CPU 32 sends a Scan Response signal (hereinafter written as“Scan_Res signal”) via the BT I/F 22 to the portable terminal that isthe source of the Scan_Req signal. The Scan_Res signal is a responsesignal to the Scan_Req signal, and includes the current SSID and thepassword (i.e. a fixed character string preset in the printer PR). Also,the Scan_Res signal is a unicast signal, and includes the BT device nameof the portable terminal (i.e. the BT device name of the source in theScan_Req signal) as information indicating its destination, and alsoincludes the BT device name “NP” of the printer PR as informationindicating its source. The CPU 32 sends the Scan_Res signal withoutestablishing a logical link. That is, the Scan_Res signal is sent to theexterior by a communication of a lower layer than a highest layer forestablishing the logical link being performed without performing acommunication of the highest layer. When S92 ends, CPU 32 returns toS70.

(Process of Portable Terminal; FIG. 4)

Next, contents of a process of the portable terminal PT1 of the presentembodiment will be explained by referring to FIG. 4. S100 to S120, S140,and S142 are the same as in the first embodiment. In the case of YES inS142, in S144, the CPU 72 of the portable terminal PT1 performs aunicast transmission of the Scan_Req signal to the printer PR which isthe connection-established printer. The Scan_Req signal may be receivedby the printer PR (refer to YES in S82 of FIG. 3).

Next, in S146, the CPU 72 determines whether or not the Scan_Res signal(refer to S92 of FIG. 3) has been received via the BT I/F 62 from theprinter PR which is the connection-established printer. The CPU 72, in acase where the Scan_Res signal has been received, determines YES inS146, and proceeds to S148. On the other hand, in a case where theScan_Res signal has not been received during a predetermined time periodafter S144 ends, the CPU 72 determines NO in S146, skips S148 to S154,and returns to S100. S148 to S154 are the same as in the firstembodiment.

(Case C; FIG. 8)

Next, a specific case of the present embodiment will be explained byreferring to FIGS. 8 and 9. An initial state of a case C of FIG. 8 isthe same as that of the case A of FIG. 5. Contents of the case C will beexplained by mainly focusing on points that differ from the case A ofFIG. 5.

In a case where the power supply is turned ON (A0), the printer PRgenerates an SSID in T202, but maintains the Wi-Fi I/F 20 in the OFFstate, and, in addition, does not shift to the G/O state (i.e. does notperform T4 of FIG. 5). Therefore, it is possible to reduce the powerconsumption of the printer PR.

In a case where the Wi-Fi connection operation is performed on theprinter PR (A1), in T204, the printer PR shifts the Wi-Fi I/F 20 to theON state, and shifts to the G/O state (YES in S10, and S11 of FIG. 7).T210 is the same as T10 of FIG. 5. Operations A1 to A4 performed on theportable terminal PT1 are the same as in FIG. 5. Also, T220 to T270 arethe same as T20 to T70 of FIG. 5. In T272, the printer PR shifts to thedevice state, shifts the Wi-Fi I/F 20 to the OFF state, and generatesthe SSID “X2” (S34A of FIG. 7). Because of performing T272, it ispossible to reduce the power consumption of the printer PR.

(Case D1; FIG. 9)

A case D1 of FIG. 9 is a continuation of the case C of FIG. 8, the Wi-FiI/F 20 is in the OFF state (refer to T272 of FIG. 8), and the BT I/F 22is in the ON state (refer to T246). Also, the BT device name “NP” of theprinter PR which is the connection-established printer is stored in theBT device name storing area 80 of the portable terminal PT1 (refer toT250). Contents of the case D1 will be explained by focusing mainly onpoints of difference from the case B of FIG. 6.

The Advertise signal of T300 includes the BT device name “NP” of theprinter PR as information indicating its source, but does not includethe SSID “X2” and the password “PS”. An operation A10 performed on theportable terminal PT1 is the same as that of FIG. 6. T302 is the same asT102 of FIG. 6.

In T310, the portable terminal PT1 sends the Scan_Req signal to theprinter PR (S144 of FIG. 4). The Scan_Req signal includes the BT devicename “NP” as information indicating its destination, and also includesthe BT device name “N1” as information indicating its source.

In a case where the Scan_Req signal is received from the portableterminal PT1, in T312, the printer PR shifts the Wi-Fi I/F 20 to the ONstate, and shifts to the G/O state (YES in S82, and S90 of FIG. 3, andYES in 540A, and S42 of FIG. 7). Then, in T314, the printer PR sends theScan_Res signal to the portable terminal PT1. The Scan_Res signalincludes the BT device name “N1” as information indicating itsdestination, and also includes the BT device name “NP” as informationindicating its source. The Scan_Res signal also includes the SSID “X2”and the password “PS”. T320 to T340 are the same as T120 to T140 of FIG.6. In T342, the printer PR shifts to the device state (i.e. stops theG/O state), shifts the Wi-Fi I/F 20 to the OFF state, and generates theSSID “X3” (S56A of FIG. 7). By performing T342, it is possible to reducethe power consumption of the printer PR.

(Case D2)

A case D2 is also a continuation of the case C. The Advertise signal ofT350 does not include the SSID “X2” and the password “PS”. A20 is thesame as that of the case B2 of FIG. 6, and T352 is the same as T152 ofFIG. 6. The portable terminal PT2 does not send the Scan_Req signal tothe printer PR (NO in S142 of FIG. 4), and as a result, does not sendthe Wi-Fi connection request signal to the printer PR.

(Effects of Second Embodiment)

In the present embodiment as well, it is possible to appropriately formthe Wi-Fi network between the printer PR and the portable terminal PT1after having performed the BT communication (refer to the case D1 ofFIG. 9). In addition, the same effects as the first embodiment are alsoachieved. In the present embodiment, the Wi-Fi setting informationincluding the SSID and the password of the printer PR is not included inthe Advertise signal. Therefore, for example, it is possible to preventthe Wi-Fi setting information from being sent to the portable terminalPT2, which is not permitted by the printer PR administrator to use theprinter PR. Therefore, the security of the printer PR can be enhanced.Furthermore, in the present embodiment, the Scan_Req signal and theScan_Res signal, respectively, are examples of the “predeterminedrequest signal” and the “response signal”. Also, the SSID and thepassword included in the Scan_Res signal are examples of the“network-related information”.

Third Embodiment

A third embodiment will be explained by focusing mainly on points ofdifference from the embodiments described above. A portable terminal(e.g. PT1) comprises the BT device name storing area (e.g. 80) in therespective embodiments described above, but in the present embodiment,does not comprise a BT device name storing area. The memory 34 of theprinter PR comprises a BT device name storing area 40 for storing the BTdevice name of the connection-established terminal (refer to FIG. 1).Also, the memory 34 does not store the sending flag 38.

(Wi-Fi I/F Related Process of Printer PR; FIG. 7)

Next, contents of the Wi-Fi I/F related process of the presentembodiment will be explained by referring to FIG. 7. S2 to S20 are thesame as in the second embodiment. In S24, the CPU 32 of the printer PRuses the Wi-Fi connection so as to receive the BT device name of theportable terminal from the portable terminal via the Wi-Fi I/F 20. Then,the CPU 32 causes the received BT device name to be stored in the BTdevice name storing area 40. Consequently, the BT device name of theconnection-established terminal is stored in the BT device name storingarea 40. When S24 ends, the CPU 32 proceeds to S30 without performed S26and S28. S30 to S34A, and 540A to S56A are the same as in the secondembodiment.

(BT I/F Related Process of Printer PR; FIG. 3)

Next, contents of the BT I/F related process of the present embodimentwill be explained by referring to FIG. 3. S70 is the same as that of thefirst and second embodiments. In S72, the CPU 32 determines whether ornot one or more BT device names are stored in the BT device name storingarea 40 in the memory 34. In a case where the one or more BT devicenames are stored, the CPU 32 determines YES in S72, and proceeds to S74,whereas in a case where no BT device names are stored, determines NO inS72, skips S74, and returns to S70.

S80 and S82 are the same as in the second embodiment. In a case whereYES is determined in S82, in S84, the CPU 32 determines whether or notthe BT device name of its source that is included in the Scan_Req signalis stored in the BT device name storing area 40 in the memory 34. In acase where the BT device name of the source is stored in the BT devicename storing area 40, that is, in a case where the portable terminalwhich is the source of the Scan_Req signal is the connection-establishedterminal, the CPU 32 determines YES in S84, and proceeds to S90. On theother hand, in a case where the BT device name of the source is notstored in the BT device name storing area 40, that is, in a case where aWi-Fi connection has not been established in the past with the portableterminal which is the source of the Scan_Req signal, the CPU 32determines NO in S84, skips S90 and S92, and returns to S70. S90 and S92are the same as in the second embodiment.

(Process of Portable Terminal; FIG. 4)

Next, contents of a process of the portable terminal PT1 of the presentembodiment will be explained by referring to FIG. 4. S100 to S114 arethe same as in the first and second embodiments. In S116, the CPU 72 ofthe portable terminal PT1 uses the Wi-Fi connection established in S114so as to send the BT device name “N1” of the portable terminal PT1 tothe printer PR via the Wi-Fi I/F 60 (S24 of FIG. 7). S118, S120 and S140are the same as in the first and second embodiments. In a case of YES inS140, the CPU 72 of the portable terminal PT1 proceeds to S144 withoutperforming S142. That is, in S144, the CPU 72 sends the Scan_Req signalto the printer PR regardless of whether or not the printer PR which isthe source of the Advertise signal is the connection-establishedprinter. S146 to S154 are the same as in the second embodiment.

(Case E; FIG. 10)

Next, a specific case of the present embodiment will be explained byreferring to FIGS. 10 and 11. An initial state of a case E of FIG. 10 isthe same as that of the case A of FIG. 5 (i.e. the initial state of thecase C of FIG. 8). Contents of the case E will be explained by focusingmainly on points of difference from the case C of FIG. 8.

A0 to A4 are the same as in FIG. 8, and T402 to T442 are the same asT202 to T242 of FIG. 8. In T444, the portable terminal PT1 uses a Wi-Ficonnection established in T442 so as to send the BT device name “N1” ofthe portable terminal PT1 to the printer PR (S116 of FIG. 4).

The printer PR, in a case where the BT device name “N1” is received fromthe portable terminal PT1, in T445, stores the BT device name “N1” inthe BT device name storing area 40 (S24 of FIG. 7). As a result, inT446, the printer PR shifts the BT I/F 22 from the OFF state to the ONstate (YES in S70, YES in S72, and S74 of FIG. 3). T460 to T472 are thesame as T260 to T272 of FIG. 8.

(Case F1; FIG. 11)

A case F1 of FIG. 11 is a continuation of the case E of FIG. 10, theWi-Fi I/F 20 is in the OFF state (refer to T472 of FIG. 10), and the BTI/F 22 is in the ON state (refer to T446). Also, the BT device name “N1”of the portable terminal PT1 which is the connection-establishedterminal is stored in the BT device name storing area 40 of the printerPR (refer to T445). Contents of the case F1 will be explained byfocusing mainly on points of difference from the case D1 of FIG. 9.

A10 is the same as in the case D1 of FIG. 9, and T500 and T510 are thesame as T300 and T310 of FIG. 9. The printer PR, in a case where theScan_Req signal is received from the portable terminal PT1, in T511,determines that the BT device name “N1” of the source of the Scan_Reqsignal is stored in the BT device name storing area 40 (YES in S84 ofFIG. 3). Therefore, in T512, the printer PR shifts the Wi-Fi I/F 20 tothe ON state, and shifts to the G/O state (S90 of FIG. 3, Yes in 540Aand S42 of FIG. 7). T514 to T542 are the same as T314 to T342 of FIG. 9.

(Case F2)

A case F2 is also a continuation of the case E. The BT device name “N2”of the portable terminal PT2 is not stored in the BT device name storingarea 40 of the printer PR. T550 is the same as T350 of FIG. 9. In a casewhere an operation of A20 is performed and the Advertise signal isreceived from the printer PR, in T560, the portable terminal PT2 sendsthe Scan_Req signal to the printer PR (YES in S140, and S144 of FIG. 4).The Scan_Req signal includes the BT device name “NP” as informationindicating its destination, and also include the BT device name “NT” asinformation indicating its source.

The printer PR, in a case where the Scan_Req signal is received from theportable terminal PT2, in T561, determines that the BT device name “N2”of the source of the Scan_Req signal included in the Scan_Req signal isnot stored in the BT device name storing area 40 (NO in S84 of FIG. 3).Therefore, the printer PR does not shift the Wi-Fi I/F 20 to the ONstate, and does not shift to the G/O state. This makes it possible toreduce the power consumption of the printer PR. The printer PR also doesnot send the Scan_Res signal to the portable terminal PT2. As a result,the portable terminal PT2 does not send the printer PR the Wi-Ficonnection request signal (NO in S146 of FIG. 4).

(Effects of Third Embodiment)

In the present embodiment as well, it is possible to appropriately formthe Wi-Fi network between the printer PR and the portable terminal PT1after having performed the BT communication (refer to the case F1 ofFIG. 11). In addition, the same effects as the first and secondembodiments are also achieved. In the present embodiment, the printer PRdoes not automatically send the Scan_Res signal including the Wi-Fisetting information to the portable terminal in a case where theScan_Req signal is received from the portable terminal, but sends theScan_Res signal including the Wi-Fi setting information to the portableterminal in response to the portable terminal being theconnection-established terminal (YES in S84 of FIG. 3). Therefore, forexample, it is possible to prevent the Wi-Fi setting information frombeing sent to the portable terminal PT2 which is not permitted by theprinter PR administrator to use the printer PR. The security of theprinter PR can be enhanced because of this.

Also, in the present embodiment, the printer PR comprises the BT devicename storing area 40, determines whether or not the BT device name ofthe portable terminal is stored in the BT device name storing area 40(S84 of FIG. 3), and changes the processing subsequent thereto inaccordance with the determination result. Therefore, the portableterminals PT1 and PT2 need not comprise a BT device name storing area,and, in addition, need not perform the determination process. Therefore,it is possible to reduce the processing loads of the portable terminalsPT1 and PT2. Furthermore, in the present embodiment, the BT device names“N1” and “N2” of the portable terminals PT1 and PT2 are examples of the“second apparatus identification information”. Also, when viewed fromthe printer PR, the portable terminal PT1 and the BT device name “N1”,respectively, are examples of the “third communication apparatus” and“third apparatus identification information”.

(Variation 1)

In S80 of FIG. 3 of the embodiments, the printer PR may send theAdvertise signal that does not include the BT device name “NP” of theprinter PR to the exterior. Then, the portable terminal PT1, in a casewhere the Advertise signal is received from the printer PR in S140 ofFIG. 4 (YES in S140), may perform S148 without performing S142 to S146.That is, the “trigger signal” may not include the “first apparatusidentification information”.

(Variation 2)

In the first and second embodiments, the printer PR may not perform S24of FIGS. 2 and 7. In this case, for example, the portable terminal PT1may perform the BT communication with the printer PR, and may receivethe BT device name “NP” from the printer PR. Also, for example, the userof the portable terminal PT1 may perform an operation for inputting theBT device name “NP” of the printer PR to the portable terminal PT1, andmay cause the BT device name “NP” to be stored in the BT device namestoring area 80.

(Variation 3)

In the third embodiment, the portable terminal PT1 may not perform S116of FIG. 4. In this case, for example, the printer PR may perform the BTcommunication with the portable terminal PT1, and may receive the BTdevice name “N1” from the portable terminal PT1. Also, for example, theuser of the portable terminal PT1 may perform an operation for inputtingthe BT device name “N1” of the portable terminal PT1 to the printer PR,and may cause the BT device name “N1” to be stored in the BT device namestoring area 40.

(Variation 4)

In the first embodiment, the BT I/F 22 of the printer PR may comprise aCPU and a memory. The memory of the BT I/F 22 may store a program andthe BT device name “NP” beforehand. While the BT I/F 22 is in the ONstate, the CPU of the BT I/F 22 may repeat the sending of the BT devicename “NP” to the exterior in accordance with the program in the memoryof the BT I/F 22 without receiving an instruction from the CPU 32 in thecontroller 30. In this case, the BT I/F 22 may have a simpleconfiguration via which two-way communication is not possible. That is,the BT I/F 22 may be incapable of performing the communication of theScan_Req signal and the Scan_Res signal. Generally, the “firstcommunication apparatus” may comprise two or more processors (e.g. theCPU 32 in the controller 30 of the printer PR and the CPU in the BT I/F22), and two or more memories (e.g. the memory 34 in the controller 30and the memory in the BT I/F 22), and the respective processors mayperform processes in accordance with the respective programs stored inthe respective memories.

(Variation 5)

In S80 of FIG. 3 of the first embodiment, the printer PR may send theAdvertise signal that does not include a password. Also, in S92 of FIG.3 of the second and third embodiments, the printer PR may send aScan_Res signal that does not include a password. In this case, apassword input screen is displayed on the portable terminal that hasreceived either the Advertise signal or the Scan_Res signal, and apassword is inputted to the portable terminal by the user. In thepresent variation, only the SSID is an example of the “network-relatedinformation”.

(Variation 6)

In the embodiments, the BT I/F 22 may be maintained in the ON statewhile the power supply to the printer PR is ON. Then, the printer PR mayrepeat the sending of the Advertise signal while the power supply to theprinter PR is ON.

(Variation 7)

In the embodiments, the password of the printer PR is fixed information,but the SSID of the printer PR is changed each time the Wi-Fi connectionbetween the printer PR and the portable terminal is disconnected.Instead of this, both the SSID and the password of the printer PR may befixed information. Then, in S80 of FIG. 3 of the first embodiment, theprinter PR may send the Advertise signal that does not include either anSSID or a password. Also, in S92 of FIG. 3 of the second and thirdembodiments, the printer PR may send the Scan_Res signal that does notinclude either an SSID or a password. In this case, the portableterminal PT1 stores both the SSID and the password of the printer PR ina case where the Wi-Fi connection with the printer PR is established inS114 of FIG. 4. Then, in S150 of FIG. 4, the portable terminal PT1 usesthe stored SSID and password to establish a Wi-Fi connection with theprinter PR. That is, the “first communication apparatus” may not sendthe network-related information to the exterior.

(Variation 8)

In S92 of FIG. 3 of the second and third embodiments, the printer PR mayestablish a BT-scheme logical link (i.e. BT connection) with theportable terminal, and use the BT connection to send the SSID and thepassword to the portable terminal. That is, the “network-relatedinformation” may be sent to the exterior without using the wirelessconnection according to the second communication scheme as in the secondand third embodiments, and may be sent to the exterior using thewireless connection according to the second communication scheme as inthe present variation.

(Variation 9)

The printer PR may not support the WFD, and instead may supportso-called SoftAP. In this case, the printer PR activates the SoftAP inS4 of FIG. 2 and in either S1 l or S42 of FIG. 7, and stops the SoftAPin S34A and S56A of FIG. 7.

(Variation 10)

The “first (or second or third) apparatus identification information”may not be the BT device name, but alternatively may be otheridentification information (e.g. a MAC address, an IP address, or thelike).

(Variation 11)

In the first embodiment, while the power supply to the printer PR is ON,the Wi-Fi I/F 20 is maintained in the ON state, and the operating stateof the printer PR is maintained in the G/O state (S4 of FIG. 2). Insteadof this, when the power supply to the printer PR is turned ON, theprinter PR may determine whether or not the sending flag 38 indicates“ON”, may perform the process of S4 in a case where the sending flag 38indicates “ON”, and may not perform the process of S4 in a case wherethe sending flag 38 indicates “OFF”. In the present variation, the Wi-FiI/F 20 may be set to the OFF state, and the operating state of theprinter PR may be set to the device state while the power supply to theprinter PR is ON, thereby making it possible to reduce the powerconsumption of the printer PR.

(Variation 12)

In the embodiments, the “first state” of the “second interface” is theOFF state in which power is not supplied to the BT I/F 22. Instead ofthis, the “first state” may be a power-saving state in which a smallamount of power is supplied to the BT I/F 22. In this case, the “firststate” may be a state in which it is possible to perform a wirelesscommunication via the BT I/F 22, and may be a state in which it is notpossible to perform a wireless communication via the BT I/F 22. However,in the case of the former, for example, the “first state” may be a statein which the communication speed is slower than in the “second state”.Then, in S74 of FIG. 3, the state of the BT I/F 22 may be shifted fromthe power-saving state to the ON state in which the power consumption ishigher than in the power-saving state. Similarly, the Wi-Fi I/F 20 mayalso be set to the power-saving state, in which a small amount of poweris supplied, instead of the OFF state.

(Variation 13)

The “first interface” may not be the I/F for performing the Wi-Ficommunication, but alternatively may be an I/F for performing thewireless communication according to another communication scheme that iscapable of forming a wireless LAN. Also, the “second interface” may notbe the I/F for performing the BT communication, but alternatively, forexample, may be an I/F for performing the wireless communicationaccording to another communication scheme capable of performing a nearfield wireless communication (e.g. TransferJet (registered trademark)scheme).

(Variation 14)

The “first communication apparatus” may not be the printer PR, butalternatively, for example, may be a scanner. In this case, for example,instead of receiving print data from the portable terminal PT1 in S30 ofFIG. 2 and FIG. 7 or S52, the scanner may send the portable terminal PT1scan data generated by performing a scan of a document. Also, the “firstcommunication apparatus” may be an apparatus that differs from a printerand a scanner (e.g. a copy machine, a facsimile machine, a telephoneset, a PC, a server, a portable terminal, or the like). Also, the“second communication apparatus” may not be the portable terminal, butalternatively may be another apparatus (e.g. a printer, a scanner, acopy machine, a facsimile machine, a telephone set, a desktop PC, aserver, or the like).

(Variation 15)

In the embodiments, the processes of FIG. 2 to FIG. 11 are realized bythe CPU 32 of the printer PR and CPU72 of the mobile terminal RT1executing the program (i.e. the software). Alternatively, at least oneof the processes from among the processes of FIG. 2 to FIG. 11 may berealized by a logic circuit or other such hardware.

What is claimed is:
 1. A printer comprising: a Wi-Fi interfaceconfigured to perform a wireless communication according to a Wi-Fischeme; a Bluetooth interface configured to perform a wirelesscommunication according to a Bluetooth scheme; a print performing unit;a processor, and a memory configured to store computer-readableinstructions, when executed by the processor, causing the printer toperform: sending a first Advertise signal according to the Bluetoothscheme via the Bluetooth interface, the first Advertise signal being asignal of which destination is not specified; receive a firstpredetermined signal from a terminal device which has received the firstAdvertise signal via the Bluetooth interface; in response to receivingthe first predetermined signal from the terminal device, establishing afirst link via the Bluetooth interface with the terminal device; sendinga first connection information to the terminal device by using theestablished first link via the Bluetooth interface, the first connectioninformation being used for establishing a first wireless connectionaccording to the Wi-Fi scheme; receiving a first wireless connectionrequest including the first connection information from the terminaldevice via the Wi-Fi interface; in response to receiving the firstwireless connection request from the terminal device, establishing thefirst wireless connection via the Wi-Fi interface with the terminaldevice; receiving first image data from the terminal device by using theestablished first wireless connection via the Wi-Fi interface; causingthe print performing unit to print an image according to the receivedfirst image data; after the first wireless connection has beendisconnected, sending a second Advertise signal according to theBluetooth scheme via the Bluetooth interface, the second Advertisesignal being a signal of which destination is not specified; receiving asecond predetermined signal from the terminal device which has receivedthe second Advertise signal via the Bluetooth interface; in response toreceiving the second predetermined signal from the terminal device,establishing a second link via the Bluetooth interface with the terminaldevice; sending a second connection information to the terminal deviceby using the established second link via the Bluetooth interface, thesecond connection information being used for establishing a secondwireless connection according to the Wi-Fi scheme, the second connectioninformation being different from the first connection information;receiving a second wireless connection request including the secondconnection information from the terminal device via the Wi-Fi interface;in response to receiving the second wireless connection request from theterminal device, establishing the second wireless connection via theWi-Fi interface with the terminal device; receiving second image datafrom the terminal device by using the established second wirelessconnection via the Wi-Fi interface; and causing the print performingunit to print an image according to the received second image data. 2.The printer as in claim 1, wherein the first connection information andthe second connection information are information for identifying anetwork according to the Wi-Fi scheme in which the printer operates as aparent station.
 3. The printer as in claim 1, wherein the firstconnection information includes a first SSID, and the second connectioninformation includes a second SSID being different from the first SSID.4. The printer as in claim 1, wherein the computer-readableinstructions, when executed by the processor, further cause the printerto perform: generating the second connection information after the firstwireless connection has been disconnected.
 5. The printer as in claim 1,wherein the computer-readable instructions, when executed by theprocessor, further cause the printer to perform: generating the firstconnection information at a timing when the printer is turned ON.
 6. Theprinter as in claim 1, wherein the first Advertise signal and the secondAdvertise signal include printer identification information foridentifying the printer, and the first predetermined signal and thesecond predetermined signal include the printer identificationinformation.
 7. The printer as in claim 1, wherein the firstpredetermined signal includes terminal identification information foridentifying the terminal device, in a case where information identicalto the terminal identification information in the first predeterminedsignal is stored in the memory, the first link is established, and in acase where information identical to the terminal identificationinformation in the first predetermined signal is not stored in thememory, the first link is not established.
 8. A non-transitorycomputer-readable recording medium storing computer-readableinstructions for a printer, wherein the printer comprising: a Wi-Fiinterface configured to perform a wireless communication according to aWi-Fi scheme; a Bluetooth interface configured to perform a wirelesscommunication according to a Bluetooth scheme; a print performing unit;and a processor, wherein the computer-readable instructions, whenexecuted by the processor, cause the printer to perform: sending a firstAdvertise signal according to the Bluetooth scheme via the Bluetoothinterface, the first Advertise signal being a signal of whichdestination is not specified; receive a first predetermined signal froma terminal device which has received the first Advertise signal via theBluetooth interface; in response to receiving the first predeterminedsignal from the terminal device, establishing a first link via theBluetooth interface with the terminal device; sending a first connectioninformation to the terminal device by using the established first linkvia the Bluetooth interface, the first connection information being usedfor establishing a first wireless connection according to the Wi-Fischeme; receiving a first wireless connection request including thefirst connection information from the terminal device via the Wi-Fiinterface; in response to receiving the first wireless connectionrequest from the terminal device, establishing the first wirelessconnection via the Wi-Fi interface with the terminal device; receivingfirst image data from the terminal device by using the established firstwireless connection via the Wi-Fi interface; causing the printperforming unit to print an image according to the received first imagedata; after the first wireless connection has been disconnected, sendinga second Advertise signal according to the Bluetooth scheme via theBluetooth interface, the second Advertise signal being a signal of whichdestination is not specified; receiving a second predetermined signalfrom the terminal device which has received the second Advertise signalvia the Bluetooth interface; in response to receiving the secondpredetermined signal from the terminal device, establishing a secondlink via the Bluetooth interface with the terminal device; sending asecond connection information to the terminal devise by using theestablished second link via the Bluetooth interface, the secondconnection information being used for establishing a second wirelessconnection according to the Wi-Fi scheme, the second connectioninformation being different from the first connection information;receiving a second wireless connection request including the secondconnection information from the terminal device via the Wi-Fi interface;in response to receiving the second wireless connection request from theterminal device, establishing the second wireless connection via theWi-Fi interface with the terminal device; receiving second image datafrom the terminal device by using the established second wirelessconnection via the Wi-Fi interface; and causing the print performingunit to print an image according to the received second image data.
 9. Aterminal device comprising a Wi-Fi interface configured to perform awireless communication according to a Wi-Fi scheme; a Bluetoothinterface configured to perform a wireless communication according to aBluetooth scheme; a processor, and a memory configured to storecomputer-readable instructions therein, the computer-readableinstructions, when executed by the processor, causing the terminaldevice to perform: after a printer sends a first Advertise signalaccording to the Bluetooth scheme, receiving the first advertise signalfrom the printer via the Bluetooth interface, the first advertise signalbeing a signal of which destination is not specified; sending a firstpredetermined signal to the printer which is a source of the firstAdvertise signal via the Bluetooth; in response to sending the firstpredetermined signal to the printer, establishing a first link via theBluetooth interface with the printer; receiving first connectioninformation from the printer by using the established first link via theBluetooth interface, the first connection information being used forestablishing a first wireless connection according to the Wi-Fi scheme;in response to receiving the first connection information from theprinter, sending a first wireless connection request including thereceived first connection information to the printer via the Wi-Fiinterface; in response to sending the first wireless connection requestto the printer, establishing a first wireless connection via the Wi-Fiinterface with the printer; sending first image data via the Wi-Fiinterface to the printer by using the first wireless connection; afterthe first Wi-Fi connection with the printer has been disconnected,receiving a second advertise signal according to the Bluetooth schemefrom the printer via the Bluetooth interface, the second Advertisesignal being a signal of which destination is not specified; sending asecond predetermined signal to the printer which is a source of thesecond Advertise signal via the Bluetooth interface; in response tosending the second predetermined signal to the printer, establishing asecond link via the Bluetooth interface with the printer; receiving asecond connection information from the printer by using the establishedsecond link via the Bluetooth interface, the second connectioninformation being used for establishing a second wireless connectionaccording to the Wi-Fi scheme, the second connection information beingdifferent from the first connection information; in response toreceiving the second connection information from the printer, sending asecond wireless connection request including the received secondconnection information to the printer via the Wi-Fi interface; and inresponse to sending the second wireless connection request to theprinter, establishing a second wireless connection via the Wi-Fiinterface with the printer; and sending second image data via the Wi-Fiinterface to the printer by using the second wireless connection. 10.The terminal device as in claim 9, wherein the first connectioninformation and the second connection information are information foridentifying a network according to the Wi-Fi scheme in which the printeroperates as a parent station.
 11. The terminal device as in claim 9,wherein the first connection information includes a first SSID, and thesecond connection information includes a second SSID being differentfrom the first SSID.
 12. The terminal device as in claim 9, wherein thefirst Advertise signal includes printer identification information foridentifying the printer, and in a case where information identical tothe printer identification information in the first Advertise signal isstored in the memory, the first predetermined signal is sent to theprinter, and in a case where information identical to the printeridentification information in the first Advertise signal is not storedin the memory, the first predetermined signal is not sent to theprinter.
 13. The terminal device as in claim 9, wherein the firstpredetermined signal and the second predetermined signal includeterminal identification information for identifying the terminal device.